plugins {
	id 'org.springframework.boot' version '3.3.1'
	id 'io.spring.dependency-management' version '1.1.5'
	id 'org.asciidoctor.jvm.convert' version '3.3.2'
	id 'org.jetbrains.kotlin.jvm' version '1.9.24'
	id 'org.jetbrains.kotlin.plugin.spring' version '1.9.24'
}

group = 'olama-api.kasp'
version = '0.0.1-SNAPSHOT'

java {
	toolchain {
		languageVersion = JavaLanguageVersion.of(21)
	}
}

repositories {
	mavenCentral()
}

ext {
	set('snippetsDir', file("build/generated-snippets"))
}

dependencies {
    // https://mvnrepository.com/artifact/org.telegram/telegrambots-spring-boot-starter
    implementation 'org.telegram:telegrambots-spring-boot-starter:6.8.0'
    implementation 'org.telegram:telegrambotsextensions:6.8.0'
    implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
	implementation 'org.springframework.boot:spring-boot-starter-quartz'
	implementation 'org.springframework.boot:spring-boot-starter-validation'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springframework.boot:spring-boot-starter-webflux'
	implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
	implementation 'io.projectreactor.kotlin:reactor-kotlin-extensions'
	implementation 'org.jetbrains.kotlin:kotlin-reflect'
	implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-reactor'
	implementation 'org.springframework.session:spring-session-data-redis'
	runtimeOnly 'org.postgresql:postgresql'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'io.projectreactor:reactor-test'
	testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'
	testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
	testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

kotlin {
	compilerOptions {
		freeCompilerArgs.addAll '-Xjsr305=strict'
	}
}

tasks.named('test') {
	outputs.dir snippetsDir
	useJUnitPlatform()
}

tasks.named('asciidoctor') {
	inputs.dir snippetsDir
	dependsOn test
}
